home *** CD-ROM | disk | FTP | other *** search
- 100 rem word count
- 110 open "SFGetFile" for input as #1
- 120 c = 0 : w = 0 : lines = 0
- 200 input #1,a$
- 300 if eof(1) then goto 900
- 400 i = 0 : while field$(a$,i+1," ") <> "" : i = i+1 : wend
- 500 w = w+i
- 600 c = c+len(a$)+1 ' for the CR
- 700 lines = lines+1
- 800 goto 200
- 900 print c;" characters, ";w;"words, ";lines;"lines"
- 1000 close #1
- 1100 end
-